home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekikoh Dennoh Club 5
/
Gekikoh Dennoh Club Vol. 5 (Japan).7z
/
Gekikoh Dennoh Club Vol. 5 (Japan) (Track 01).bin
/
tools
/
pmake
/
pmake.c
next >
Wrap
Text File
|
1998-10-03
|
19KB
|
871 lines
/*
ÉVpostmake
1997.09.19
1998.10.01 : ÉVâtâHü[â}âbâgé╔æ╬ë₧
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define VERSION "2.00"
typedef unsigned char uchar;
void main( int argc, uchar *argv[] );
void usage( void );
void get_koumoku( int num_koumoku, uchar *str_ret_ptr );
void ke_test( uchar *strptr );
int str_ncmp( uchar *gen_todo, uchar *work_todo );
void number_check( uchar *juusyo2, uchar *juusyo1 );
void put_data( uchar shikibetu, uchar *juusyo );
int get_ken_code( uchar *moto );
int shiku_hantei( uchar *shiku, int yomi_ken );
void num_put( void );
void del_last_char( uchar workstr[128] );
void shiku_bunri( int yomi_ken );
int gun_bunri( int yomi_ken );
void syori( void );
/*
âOâìü[âoâïò╧ÉöÉΘî╛
*/
FILE *ai,*bi; /* âtâ@âCâïùp */
int ctr, /* âJâEâôâ^üiâIâtâZâbâgÄZÅoùpüj */
tousyo_sw = 0, /* ôçé╡éσÅêù¥âXâCâbâ` */
old_kubun = 0, /* Æ╝æOé╔Åêù¥é╡é╜âfü[â^é╠ÄsƼæ║ïµò¬ */
shiku_kubun = 0; /* ÄsƼæ║ïµò¬ */
uchar ken, /* îºâRü[âh */
moto_str[256], /* î│âtâ@âCâïé⌐éτé╠ôⁿù═ìsò█Ä¥ùpò╢ÄÜù± */
old_kugun[64],
gun_yomi[64],
tyouson_yomi[64],
gen_todo[9], /* î╗ì▌Åêù¥Æåé╠ôsô╣ò{îºû╝ */
gen_shiku[23], /* î╗ì▌Åêù¥Æåé╠ÄsïµîSƼæ║û╝ */
gen_shi[32],
gen_gun[32];
uchar work_todo[9],
work_shiku[64],
work_shigun[64],
work_azamei[1024],
work_azamei2[128],
work_yomi[128];
uchar seirei_toshi[12][2][10] = { /* É¡ù▀ÄwÆΦôsÄs */
"ÄDûyÄs", "╗┬╬▀█╝",
"ÉσæΣÄs", "╛▌└▐▓╝",
"ÉτùtÄs", "┴╩▐╝",
"ëíòlÄs", "╓║╩╧╝",
"É∞ìΦÄs", "╢▄╗╖╝",
"û╝î├ë«Äs", "┼║▐╘╝",
"ï₧ôsÄs", "╖╓│─╝",
"æσìπÄs", "╡╡╗╢╝",
"É_î╦Äs", "║│═▐╝",
"ìLôçÄs", "╦█╝╧╝",
"ûkïπÅBÄs", "╖└╖╒│╝╒│╝",
"òƒë¬Äs", "╠╕╡╢╝"
};
int seirei_toshisuu = 12;
uchar tousyo[9][2][11] = { /* ôçé╡éσ */
"æσôç", "╡╡╝╧",
"ùÿôç", "─╝╧",
"ÉVôç", "╞▓╝▐╧",
"É_Æ├ôç", "║│┬▐╝╧",
"ÄOæεôç", "╨╘╣╝▐╧",
"îΣæáôç", "╨╕╫╝▐╧",
"ö¬ÅΣôç", "╩┴╝▐╓│╝▐╧",
"É┬âPôç", "▒╡╢▐╝╧",
"żè}î┤Åöôç", "╡╢▐╗▄╫╝╓─│"
};
int tousuu = 9;
/*
âüâCâô
*/
void
main( int argc, uchar *argv[] )
{
setvbuf( stdout, NULL, _IONBF, 0 ); /* òWÅÇÅoù═é╠âoâbâtâ@ï╓Ä~ */
/* é▒é┴é┐é╠ò√é¬ò\Īé¬é⌐é┴é▒ù╟éóé╠é┼ */
tousyo_sw = 0;
/* ai : î│âtâ@âCâï all.csv */
if( (ai = fopen( "all.csv", "rt")) == NULL) {
puts("ò╧è╖î│âtâ@âCâï all.csv é¬âIü[âvâôé┼é½é▄é╣é±üB");
usage();
exit( 1 );
}
/* bi : Åöî│âtâ@âCâï post.dat */
if( (bi = fopen( "post.dat", "wt")) == NULL) {
puts("Åöî│âtâ@âCâï post.dat é¬âIü[âvâôé┼é½é▄é╣é±üB");
usage();
exit( 1 );
}
ken = 0; /* îºâRü[âhé═é╞éΦéáéªé╕éO */
ctr = 0; /* âJâEâôâ^âèâZâbâg */
gen_todo[ 0 ] = '\0'; /* î╗ì▌Åêù¥Æåé╠ôsô╣ò{îºû╝ */
gen_shiku[ 0 ] = '\0'; /* î╗ì▌Åêù¥Æåé╠ÄsïµÆ¼æ║û╝ */
/*
û{Åêù¥
*/
do {
if( fgets( moto_str, 256, ai ) == NULL ) {
if( feof(ai) ) {
break;
} else {
printf("âtâ@âCâïô╟é▌ì₧é▌âGâëü[\n");
usage();
exit(1);
}
}
syori(); /* ÆåÉgé≡Åêù¥ */
} while( 1 );
puts("");
fclose( ai );
fclose( bi );
return;
}
/*
Ägùpû@ò\Ī
*/
void
usage()
{
printf("ùXò╓ö╘ìåâtâ@âCâïò╧è╖âvâìâOâëâÇ postmake Ver %s",VERSION);
printf(" Created by Æåæ║ù▓É╢üiû₧èJÉ╗ì∞Åèüj 1993.\n\n");
printf("Ägùpû@üFpostmake <î│âtâ@âCâïû╝éP> <î│âtâ@âCâïû╝éQ>\n");
printf(" âJâîâôâgâfâBâîâNâgâèé╔ùXò╓ö╘ìåâtâ@âCâï post.dat é╞");
printf("âIâtâZâbâg post.ofs é≡ì∞ɼé╡é▄é╖üB\n");
return;
}
/*
ìÇû┌ĵô╛
ùvïüÄdùlüF
moto_str é╠éÄö╘û┌é╠ìÇû┌é≡ĵô╛é╖éΘüB
ô╛é╜ò╢ÄÜù±é═str_ret_ptré╔èiö[é╖éΘüB
ìÇû┌é═òKé╕â_âuâïâNâHü[âeü[âVâçâôé┼ê═é▄éΩé─éóéΘéαé╠é╞é╖éΘüB
ìÇû┌âXâLâbâvé╠û┌ê≤é╔é═âJâôâ}é╞ " é≡Ägùpé╡é─éóéΘé¬üAâVâtâgéiéhéré╠
ò╢ÄÜé╔é═âJâôâ}é╞ " é═Ägùpé╡é─éóé╚éóüB
*/
void
get_koumoku( int num_koumoku, uchar *str_ret_ptr )
{
int i1, /* âïü[âvö─ùp */
len;
uchar *moto_ptr, /* âÅü[âNé╠â|âCâôâ^ */
*check_ptr; /* â`âFâbâNùpé╠â|âCâôâ^ */
check_ptr = str_ret_ptr; /* â|âCâôâ^é╠æ╥ö≡ */
moto_ptr = moto_str; /* â|âCâôâ^é╠âZâbâg */
/*
ìÇû┌é╠ô¬Åoé╡
*/
for( i1=1; i1<=num_koumoku-1; ++i1 ) {
while( (*moto_ptr++) != ',' ) /* ăé╠üu,üvé▄é┼ô╟é▌é╞é╬é╡ */
;
}
moto_ptr++; /* é╗é╠ăé╠üu"üvéαô╟é▌é╞é╬é╡ */
for(;;) { /* ăé╠üu"üvé▄é┼ò╢ÄÜù±é≡òíÄ╩ */
if( *moto_ptr != '\"' && *moto_ptr != ' ' ) { /* üu"üvé╞ö╝èpSPé═ */
*str_ret_ptr++ = *moto_ptr++; /* òíÄ╩é╡é╚éó */
} else {
break;
}
}
*str_ret_ptr = '\0'; /* ÅIÆ[ïLìåé╠òtë┴ */
if( num_koumoku == 4 || num_koumoku == 5 || num_koumoku == 6 ) {
len = strlen( check_ptr );
for( i1=0; i1<=len-1; i1++ ) {
if( *check_ptr == 0xaf ) { /* » */
*check_ptr = 0xc2; /* ┬ */
} else if( *check_ptr == 0xac ) { /* ¼ */
*check_ptr = 0xd4; /* ╘ */
} else if( *check_ptr == 0xad ) { /* ¡ */
*check_ptr = 0xd5; /* ╒ */
} else if( *check_ptr == 0xae ) { /* « */
*check_ptr = 0xd6; /* ╓ */
}
check_ptr++;
}
} else {
ke_test( check_ptr ); /* âòé╞âûé╠âeâXâg */
}
return;
}
/*
âòé╞âûé╠âeâXâg
âòé⌐âûé≡î⌐òté»é╜éτüAé╗éΩé╝éΩâJé╞âPé╔ò╧è╖é╖éΘ
*/
void
ke_test( uchar *strptr )
{
int i1 = 0, /* âïü[âvö─ùp */
len = 0; /* Æ╖é│ */
len = strlen( strptr );
for( i1=0; i1<=len-1; i1+=2 ) { /* æ╬Å█é═æSòöæSèpé╚é╠é┼éQî┬é╞é╬é╡ */
if( *strptr == 0x83 ) { /* 83 ücüc âòé╞âûé╠éPâoâCâgû┌ */
strptr++; /* éPî┬Éié▀éΘ */
if( *strptr == 0x95 ) { /* âò */
*strptr = 0x4a; /* âJ */
} else if( *strptr == 0x96 ) { /* âû */
*strptr = 0x50; /* âP */
}
strptr++; /* éPî┬Éié▀éΘ */
} else {
strptr += 2; /* éQî┬Éié▀éΘ */
}
}
return;
}
/*
ìéæ¼é╚üiéñé╗üjò╢ÄÜù±Å╞ìçâïü[â`âô
*/
int
str_ncmp( uchar *gen_todo, uchar *work_todo )
{
if( *gen_todo != *work_todo ) { /* é▄é╕ɵô¬éPò╢ÄÜé≡öΣèré╡é─é╡é▄éñ */
return 1;
}
return ( strcmp( gen_todo, work_todo ) );
}
/*
ÉöÄÜâ`âFâbâN
æSèpÉöÄÜé≡ö╝èpÉöÄÜé╔é╡é─ò╘é╖
*/
void
number_check( uchar *juusyo2, uchar *juusyo1 )
{
int len_str = 0, /* ò╢ÄÜù±Æ╖é│ */
i1 = 0; /* âïü[âvö─ùp */
len_str = strlen( juusyo1 );
for( i1=0; i1<=len_str-1; i1++ ) {
if( isdigit( (int)*juusyo1 ) ) { /* é╖é┼é╔ö╝èpÉöÄÜüüùXò╓ö╘ìå */
*juusyo2++ = *juusyo1++; /* éPâoâCâgé╛é» */
continue;
}
// if( *juusyo1 == 0x82 ) { /* æSèpÉöÄÜé╠éPâoâCâgû┌üH */
//
// if( (*(juusyo1+1) <= 0x59) && (*(juusyo1+1) >= 0x4f) ) {
// ++juusyo1; /* éPî┬Éié▀éΘ */
// *juusyo2++ = (*juusyo1++) - 0x1f; /* ö╝èpÉöÄÜë╗ */
// } else {
// *juusyo2++ = *juusyo1++; /* é╜é╘é±æSèp */
// *juusyo2++ = *juusyo1++;
// }
// } else {
*juusyo2++ = *juusyo1++; /* æSèpé╛é╞éóéóé╚ */
*juusyo2++ = *juusyo1++;
// }
++i1; /* é╨éªü` */
}
*juusyo2 = '\0'; /* ÅIÆ[ò╢ÄÜé≡âZâbâg */
return;
}
/*
ÅZÅèâfü[â^Åoù═
ö╝èpëpÄÜéPò╢ÄÜé╞ÅZÅèé≡Ä≤é»ÄµéΘüB
ëpÄÜéPò╢ÄÜé╞ÅZÅèé≡é╗é╠é▄é▄ ci é╔Åæé½Åoé╡üA
âOâìü[âoâïò╧Éö ctr é╔éPü{üiÅZÅèé╠ò╢ÄÜÉöüjé≡æ½é╡ì₧é▐üB
*/
void
put_data( uchar shikibetu, uchar *juusyo )
{
uchar juusyo2[1024], /* Ä≤é»ÄM */
*j2_ptr;
j2_ptr = juusyo2; /* â|âCâôâ^âZâbâg */
number_check( j2_ptr, juusyo ); /* ÉöÄÜâ`âFâbâN */
fputc( shikibetu, bi );
fputs( j2_ptr, bi );
ctr += (1 + strlen( j2_ptr ) );
return;
}
/*
éαéτé┴é╜ìsé⌐éτîºâRü[âhé≡ÆèÅoé╡é─ò╘é╖
*/
int
get_ken_code( uchar *moto )
{
uchar ch1, ch2;
ch1 = moto[0];
ch2 = moto[1];
return ((ch1 - 0x30) * 10) + (ch2 - 0x30);
}
/*
ÄsïµîSö╗ÆΦ
ûûö÷é╠éPÄÜé≡î⌐é─üAÄsïµîSé╠ö╗ÆΦé≡ìséóüAû▀éΦÆlé╞é╖éΘüB
éPüüÄsü@éQüüÄsôαïµü@éRüüô┴ò╩ïµü@éSüüîSü{Ƽü@éTüüîSü{æ║
*/
int
shiku_hantei( uchar *shiku, int yomi_ken )
{
int kubun = 0, /* Äsïµïµò¬ */
len_shiku; /* Æ╖é│èiö[ùp */
uchar moji_work[3]; /* æSèpéQò╢ÄÜâÅü[âN */
len_shiku = strlen( shiku ); /* é▄é╕Æ╖é│é≡ô╛éΘ */
moji_work[0] = shiku[len_shiku-2]; /* ûûö÷é╠éPò╢ÄÜüié╜é╛é╡æSèpüjé≡ô╛éΘ */
moji_work[1] = shiku[len_shiku-1];
moji_work[2] = '\0';
/* î┤ÄnôIé╚Äûé≡éΓé┴é─é▄é╖é¬üAÆPé╚éΘ */
/* ÄΦö▓é½é┼é╖é╠é┼ïCé╔é╡é╚éóé┼éóéóé┼é╖ */
if( str_ncmp( moji_work, "Äs" ) == 0 ) {
kubun = 1; /* ÆPé╚éΘÄs */
} else if( str_ncmp( moji_work, "ïµ" ) == 0 ) {
if( yomi_ken == 13 ) { /* ôîï₧ôsôαé┼éáéΘ */
kubun = 3; /* ôîï₧ôsô┴ò╩ïµ */
} else {
kubun = 2; /* É¡ù▀ÄwÆΦôsÄsôαé╠ïµ */
}
} else if( str_ncmp( moji_work, "Ƽ" ) == 0 ) {
kubun = 4; /* Ƽ */
} else if( str_ncmp( moji_work, "æ║" ) == 0 ) {
kubun = 5; /* æ║ */
} else {
printf("FAIL : ûûö÷é¬ÄsïµÆ¼æ║é┼é╚éóüi|%s|üj\n",moji_work);
exit(1);
}
return( kubun );
}
/*
ùXò╓ö╘ìåé╠èlô╛é╞ÅæÅo
*/
void
num_put()
{
uchar bangou[8], /* ùXò╓ö╘ìåùpâÅü[âN */
kban[8]; /* ïîö╘ìå */
get_koumoku( 3, bangou ); /* ùXò╓ö╘ìåé≡ô╛éΘ */
get_koumoku( 2, kban );
/*
ïîö╘ìåé╞ÉVö╘ìåé╠öΣèrâ`âFâbâNüFîïì\êßéñé▒é╞é¬ò¬é⌐é┴é╜é╠é┼âRâüâôâgâAâEâg
k_len = strlen( kban );
for( i1=0; i1<=k_len-1; i1++ ) {
if( bangou[i1] != kban[i1] ) {
printf("ö╜ùßö¡î⌐ |%s| != |%s|\n",bangou,kban);
break;
}
}
*/
put_data( '*', bangou ); /* ùXò╓ö╘ìåÅoù═ */
put_data( '\'', kban ); /* ïîö╘ìåÅoù═ */
return;
}
/*
îπé╠æSèpéPò╢ÄÜé≡ìφÅ£é╖éΘ
*/
void
del_last_char( uchar workstr[128] )
{
int len_str = 0;
len_str = strlen( workstr );
workstr[ len_str - 2 ] = '\0';
return;
}
/*
Äsïµò¬ùú
É¡ù▀ÄwÆΦôsÄsé╠é▌üFÄsû╝é⌐éτïµû╝é≡ò¬ùúé╖éΘ
*/
void
shiku_bunri( int yomi_ken )
{
int nagasa=0,
nagasa2=0,
cnt=0,
toshi=0,
i1;
uchar basyo[64];
nagasa = strlen( work_shiku );
/* üuÄsüvé╠ÄÜé≡ÆTé╖ 8e73 */
/* éPò╢ÄÜû┌é╞ì┼îπé╠ò╢ÄÜé═ÆTé│é╚éó */
for( i1=2; i1<=nagasa-4; i1+=2 ) {
if( work_shiku[i1] == 0x8e && work_shiku[i1+1] == 0x73 ) {
cnt++;
basyo[cnt] = i1;
}
}
switch( cnt ) {
/* üuÄsüvé╠ò╢ÄÜé¬é╨é╞é┬éαé╚éóüüé¿é⌐é╡éó */
case 0:
printf("Äsé¬é╚éóüBé¿é⌐é╡éó|%s|\n",work_shiku);
break;
/* üuÄsüvé╠ò╢ÄÜé¬é╨é╞é┬üüòüÆ╩ */
case 1:
/* Äsû╝é≡ò¬ùú */
for( i1=0; i1<=basyo[1]-1; i1++ ) {
work_shigun[i1] = work_shiku[i1];
}
work_shigun[basyo[1]] = '\0';
/* ïµû╝é≡ò¬ùú */
for( i1=basyo[1]+2; i1<=nagasa-1; i1++ ) {
work_shiku[i1-basyo[1]-2] = work_shiku[i1];
}
work_shiku[nagasa-basyo[1]-2] = '\0';
/* Äsû╝é≡ô┴ÆΦ */
toshi = -1;
for( i1=0; i1<=seirei_toshisuu-1; i1++ ) {
if( strstr( work_yomi, seirei_toshi[i1][1] ) != NULL ) {
toshi = i1;
break;
}
}
if( toshi == -1 ) {
printf("Äsû╝é¬î╗éΩé╚é⌐é┴é╜üBé¿é⌐é╡éó|%s|\n",work_yomi);
return;
}
/* Äsû╝é≡ò¬ùú */
strcpy( gun_yomi, seirei_toshi[toshi][1] );
/* ïµû╝é≡ò¬ùú */
nagasa = strlen( work_yomi );
nagasa2 = strlen( seirei_toshi[toshi][1] );
for( i1=nagasa2; i1<=nagasa-1; i1++ ) {
tyouson_yomi[i1-nagasa2] = work_yomi[i1];
}
tyouson_yomi[nagasa - nagasa2] = '\0';
break;
case 2:
printf("Äsé¬é╙é╜é┬|%s|\n",gen_shiku);
break;
/* é╗é╠æ╝üüé¿é⌐é╡éó */
default:
printf("Äsé¬éRé┬ê╚ÅπéáéΘüB|%s|\n",gen_shiku);
break;
}
return;
}
/*
îSò¬ùú
Ƽæ║û╝é⌐éτîSû╝é≡ò¬ùúé╖éΘ
*/
int
gun_bunri( int yomi_ken )
{
int nagasa=0,
nagasa2 = 0,
ret = 0,
cnt=0,
shima = 0,
i1;
uchar basyo[64];
nagasa = strlen( work_shiku );
/* üuîSüvé╠ÄÜé≡ÆTé╖ 8c53 */
/* éPò╢ÄÜû┌é╞ì┼îπé╠ò╢ÄÜé═ÆTé│é╚éó */
for( i1=2; i1<=nagasa-4; i1+=2 ) {
if( work_shiku[i1] == 0x8c && work_shiku[i1+1] == 0x53 ) {
cnt++;
basyo[cnt] = i1;
}
}
switch( cnt ) {
/* üuîSüvé╠ò╢ÄÜé¬é╨é╞é┬éαé╚éóüüôîï₧ôsôçé╡éσé╠ô┴ùß */
case 0:
/* üuôçüvé╠ÄÜé≡ÆTé╖ */
for( i1=2; i1<=nagasa-4; i1+=2 ) {
if( work_shiku[i1] == 0x93 && work_shiku[i1+1] == 0x87 ) {
cnt++;
basyo[cnt] = i1;
}
}
/* Ƽæ║û╝é≡ò¬ùú */
for( i1=basyo[1]+2; i1<=nagasa-1; i1++ ) {
work_shiku[i1-basyo[1]-2] = work_shiku[i1];
}
work_shiku[nagasa-basyo[1]-2] = '\0';
/* ôçû╝é≡ô┴ÆΦ */
shima = -1;
for( i1=0; i1<=tousuu-1; i1++ ) {
if( strstr( work_yomi, tousyo[i1][1] ) != NULL ) {
shima = i1;
break;
}
}
if( shima == -1 ) {
printf("ôçû╝é¬î╗éΩé╚é⌐é┴é╜üBé¿é⌐é╡éó|%s|\n",work_yomi);
return 0;
}
/* Ƽæ║û╝é≡ò¬ùú */
nagasa = strlen( work_yomi );
nagasa2 = strlen( tousyo[shima][1] );
for( i1=nagasa2; i1<=nagasa-1; i1++ ) {
tyouson_yomi[i1-nagasa2] = work_yomi[i1];
}
tyouson_yomi[nagasa - nagasa2] = '\0';
ret = 1;
if( tousyo_sw == 0 ) {
strcpy( work_shigun, "ôçé╡éσ" );
strcpy( gun_yomi, "─│╝╓" );
tousyo_sw = 1;
}
break;
/* üuîSüvé╠ò╢ÄÜé¬é╨é╞é┬üüòüÆ╩üAé╙é╜é┬üüƼû╝é╠Æåé╔üuîSüvé╠ÄÜé¬ÄgéφéΩé─éóéΘ */
case 1:
case 2:
/* îSû╝é≡ò¬ùú */
for( i1=0; i1<=basyo[1]-1; i1++ ) {
work_shigun[i1] = work_shiku[i1];
}
work_shigun[basyo[1]] = '\0';
/* Ƽæ║û╝é≡ò¬ùú */
for( i1=basyo[1]+2; i1<=nagasa-1; i1++ ) {
work_shiku[i1-basyo[1]-2] = work_shiku[i1];
}
work_shiku[nagasa-basyo[1]-2] = '\0';
/* îSé╠ô╟é▌üu╕▐▌üvé╠ê╩Æué≡ô┴ÆΦ */
cnt = 0;
nagasa = strlen( work_yomi );
for( i1=2; i1<=nagasa; i1++ ) {
if( work_yomi[i1 ]==0xb8 &&
work_yomi[i1+1]==0xde &&
work_yomi[i1+2]==0xdd ) {
cnt++;
basyo[1] = i1;
break;
}
}
/* îSû╝é╠ô╟é▌é≡ò¬ùú */
for( i1=0; i1<=basyo[1]+2; i1++ ) {
gun_yomi[i1] = work_yomi[i1];
}
gun_yomi[basyo[1]+3] = '\0';
/* Ƽæ║û╝é╠ô╟é▌é≡ò¬ùú */
for( i1=basyo[1]+3; i1<=nagasa-1; i1++ ) {
tyouson_yomi[i1-basyo[1]-3] = work_yomi[i1];
}
tyouson_yomi[nagasa-basyo[1]-3] = '\0';
break;
/* é╗é╠æ╝üüé¿é⌐é╡éó */
default:
printf("é¿é⌐é╡éóüBüuîSüvé¬éRé┬ê╚Åπ|%s|",work_shiku);
break;
}
return ret;
}
/*
û{Åêù¥
*/
void
syori()
{
int i1 = 0,
tou = 0,
touhenka = 0,
nagasa = 0,
hiraki = 0, /* èJé½èçî╩Éö */
toji = 0, /* ò┬é╢èçî╩Éö */
kakko_check = 0,
yomi_ken=0;
uchar
shityou_henka = 0;
/*
ò╧Éöé╠Åëè·ë╗
*/
yomi_ken = get_ken_code( moto_str ); /* éóé▄ô╟é±é╛ìsé╠îºâRü[âhé≡ô╛éΘ */
/*
æµéVìÇü@ôsô╣ò{îºû╝é╠Åêù¥
*/
get_koumoku( 7, work_todo ); /* ôsô╣ò{îºû╝é≡ô╛éΘ */
get_koumoku( 4, work_yomi ); /* é╗é╠ô╟é▌é≡ô╛éΘ */
if( str_ncmp( gen_todo, work_todo ) != 0 ) { /* ÉVé╡éóôsô╣ò{îºû╝é┼éáéΘ */
put_data( ' ', work_todo ); /* âtâ@âCâïé╔Åæé½Åoé╡ */
put_data( '+', work_yomi ); /* ô╟é▌éα */
strcpy( gen_todo, work_todo ); /* ôsô╣ò{îºû╝é≡ìXÉV */
gen_shiku[0] = '\0'; /* ÄsïµîSƼæ║û╝é╠Åëè·ë╗ */
printf("\n\n%s\n",gen_todo);
}
/*
æµéWìÇü@ÄsïµîSƼæ║û╝é╠Åêù¥
*/
get_koumoku( 8, work_shiku );
get_koumoku( 5, work_yomi );
old_kubun = shiku_kubun;
shiku_kubun = shiku_hantei( work_shiku, yomi_ken ); /* Äsé⌐ïµé⌐îSé⌐ö╗ÆΦé╖éΘ */
if( str_ncmp( gen_shiku, work_shiku ) != 0 ) { /* ÉVé╡éóÄsïµîSƼæ║û╝é┼éáéΘ */
shityou_henka = 1; /* ÉVé╡éóé╠é┼âtâëâOùºé─éΘ */
strcpy( gen_shiku, work_shiku ); /* ÄsïµîSƼæ║û╝é≡ìXÉV */
del_last_char( work_shiku ); /* ûûö÷é╠æSèpéPò╢ÄÜé≡ìφÅ£ */
switch( shiku_kubun ) {
/* Äs */
case 1:
if( old_kubun == 2 || old_kubun == 3 ) { /* Æ╝æOé¬ïµé╚éτ */
printf("\n"); /* ëⁿìsé╖éΘ */
}
put_data( '!', work_shiku ); /* âtâ@âCâïÅæé½Åoé╡ */
put_data( '+', work_yomi );
printf("%sÄs ", work_shiku );
break;
/* É¡ù▀ÄwÆΦôsÄsôαé╠ïµ */
case 2:
strcpy( old_kugun, gen_gun ); /* Æ╝æOé╠Äsû╝é≡æ▐ö≡ */
shiku_bunri( yomi_ken );
if( str_ncmp( work_shigun, old_kugun ) != 0 ) { /* Äsû╝é¬êßéñé╚éτ */
if( old_kubun == 2 ) { /* Æ╝æOé¬Äsôαïµé╚éτ */
printf("\n"); /* ëⁿìsé╖éΘ */
}
strcpy( gen_gun, work_shigun ); /* Åêù¥Æåé╠Äsû╝é≡ìXÉV */
put_data( '!', gen_gun );
put_data( '+', gun_yomi );
printf("%sÄs : ", gen_gun );
}
put_data( '$', work_shiku );
put_data( '+', tyouson_yomi );
printf("%sïµ ", work_shiku );
break;
/* ô┴ò╩ïµ */
case 3:
put_data( '\"', work_shiku ); /* âtâ@âCâïÅæé½Åoé╡ */
put_data( '+', work_yomi );
printf("%sïµ ", work_shiku );
break;
/* Ƽ */
case 4:
if( old_kubun != 4 && old_kubun != 5 ) {
gen_gun[0] = '\0';
}
strcpy( old_kugun, gen_gun ); /* Æ╝æOé╠îSû╝é≡æ▐ö≡ */
tou = gun_bunri( yomi_ken );
/* îSû╝é¬êßéñé╚éτüiôçé╡éσé≡Å£é¡üj */
// if( tou==0 && str_ncmp( work_shigun, old_kugun ) != 0 ) {
if( str_ncmp( work_shigun, old_kugun ) != 0 ) {
strcpy( gen_gun, work_shigun ); /* Åêù¥ÆåîSû╝é≡ìXÉV */
put_data( '#', gen_gun );
put_data( '+', gun_yomi );
printf("\n%sîS : ",gen_gun);
}
// if( touhenka == 0 && tou == 1 ) { /* ôçé╡éσé╔ôⁿé┴é╜ */
// puts("");
// touhenka = 1;
// }
put_data( ':', work_shiku ); /* âtâ@âCâïÅæé½Åoé╡ */
put_data( '+', tyouson_yomi );
printf("%sƼ ", work_shiku );
break;
/* æ║ */
case 5:
if( old_kubun != 4 && old_kubun != 5 ) {
gen_gun[0] = '\0';
}
strcpy( old_kugun, gen_gun ); /* Æ╝æOé╠îSû╝é≡æ▐ö≡ */
tou = gun_bunri( yomi_ken );
/* îSû╝é¬êßéñé╚éτüiôçé╡éσé≡Å£é¡üj */
// if( tou==0 && str_ncmp( work_shigun, old_kugun ) != 0 ) {
if( str_ncmp( work_shigun, old_kugun ) != 0 ) {
strcpy( gen_gun, work_shigun ); /* Åêù¥ÆåîSû╝é≡ìXÉV */
put_data( '#', gen_gun );
put_data( '+', gun_yomi );
printf("\n%sîS : ", gen_gun);
}
// if( touhenka == 0 && tou == 1 ) { /* ôçé╡éσé╔ôⁿé┴é╜ */
// puts("");
// touhenka = 1;
// }
put_data( ';', work_shiku ); /* âtâ@âCâïÅæé½Åoé╡ */
put_data( '+', tyouson_yomi );
printf("%sæ║ ", work_shiku );
break;
}
}
if( shityou_henka ) { /* ò╧ë╗é╡é╜é╬é⌐éΦé┼éáéΘ */
get_koumoku( 9, work_azamei ); /* ÄÜû╝é≡ô╛éΘ */
if( strstr( work_azamei, "ê╚ë║é╔îfì┌é¬" ) == NULL ) {
/* ô¬é╠ìsé╚é╠é╔üuê╚ë║é╔îfì┌é¬é╚éóÅΩìçüvé¬é╚éó */
if( strstr( work_azamei, "êΩë~" ) == NULL ) { /* êΩë~é┼éαé╚éó */
/* êΩë~é╞éóéñÆnû╝éαéáéΘé¬üAé╗é╠Ä₧é═ shityou_henka é═
ü@ü@ùºé┴é─éóé╚éóé═é╕é┼éáéΘé╠é┼ */
printf("é¿é⌐é╡éóüBô¬é╠ìsé╚é╠é╔üuê╚ë║é╔îfì┌üvé¬é╚éó|%s|%s|\n",
work_shiku,work_azamei);
}
}
num_put(); /* ö╘ìåé≡Åæé¡üüèYôûé╚é╡Ä₧ö╘ìå */
shityou_henka = 0; /* âtâëâOÉQé╣éΘ */
} else {
/* ÄÜû╝Åêù¥ */
get_koumoku( 9, work_azamei );
get_koumoku( 6, work_yomi );
/* èçî╩æ╢ì▌â`âFâbâN */
if( strstr( work_azamei, "üi" ) != NULL ) { /* èçî╩é¬éáéΩé╬ */
kakko_check = 0;
do {
/* èçî╩Éöé≡Æ▓é╫éΘü@èJé½èçî╩üü0x8169üAò┬é╢èçî╩üü0x816a */
nagasa = strlen( work_azamei );
hiraki = 0;
toji = 0;
for( i1=0; i1<=nagasa-2; i1++ ) { /* éQò╢ÄÜé¿é½ */
if( work_azamei[i1 ] == 0x81 &&
work_azamei[i1+1] == 0x69 ) { /* üi */
hiraki++;
} else
if( work_azamei[i1 ] == 0x81 &&
work_azamei[i1+1] == 0x6a ) { /* üj */
toji++;
}
}
/* ï╧ôÖé¬ÄµéΩé─éóé╚éóüüăé╠ìsé╔æ▒éóé─éóéΘ */
if( hiraki - toji != 0 ) {
/* éαéñéPìsâQâbâgé╖éΘüüé▒éΩé═ê└æSé╔ĵéΩéΘé═é╕ */
fgets( moto_str, 256, ai );
get_koumoku( 9, work_azamei2 ); /* ìÇû┌âQâbâg */
if( strlen( work_azamei ) +
strlen(work_azamei2) >= 2048 ) {
printf("ò╢ÄÜù±é¬Æ╖é╖é¼éΘ:|%s|%s|\n",
work_azamei,work_azamei2);
}
/* âRâôâJâ` */
strcat( work_azamei, work_azamei2 );
} else {
kakko_check = 1;
}
} while( kakko_check == 0 );
}
put_data( '%', work_azamei );
put_data( '+', work_yomi );
num_put();
}
return;
}